package com.ogawa.base.base

abstract class LazyFragment : BaseFragment() {

    private var isDataComplete = false

    override fun onPause() {
        super.onPause()
        if (!isDataComplete) {
            stopLoadData()
        }
    }

    override fun onResume() {
        super.onResume()
        if (!isDataComplete) {
            firstLoadData()
        }
    }

    open fun firstLoadData() {

    }

    open fun stopLoadData() {

    }

    fun setIsDataComplete(complete: Boolean) {
        isDataComplete = complete
    }
}